<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org"  xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <meta charset="UTF-8">
    <title>用户管理页面</title>
    <link rel="stylesheet" th:href="@{/layui1/css/layui.css}" media="all">
    <script th:src="@{/layui1/layui.js}"></script>
    <script th:src="@{/user/js/user.js}"></script>
</head>
<style>
    body {
        margin: 10px;
    }
</style>
<body>

<script type="text/html" id="barDemo">
    <a class="layui-btn layui-btn-radius" lay-event="edit">编辑</a>
    <a class="layui-btn layui-btn-radius layui-btn-danger" lay-event="del">删除</a>
    <a class="layui-btn layui-btn-radius" lay-event="resetPassword">重置密码</a>
</script>

<!--=========================================================以上是模板================================================================-->

<!--=========================================================多条件查询================================================================-->
<fieldset class="table-search-fieldset">
    <legend>搜索信息</legend>
    <div style="margin: 10px 10px 10px 10px">
        <form class="layui-form layui-form-pane" id="searchForm">
            <div class="layui-form-item">
                <div class="layui-inline">
                    <label class="layui-form-label">登录账号</label>
                    <div class="layui-input-inline">
                        <input type="text" name="searchLoginName" autocomplete="off" class="layui-input">
                    </div>
                </div>
                <div class="layui-inline">
                    <label class="layui-form-label">真实姓名</label>
                    <div class="layui-input-inline">
                        <input type="text" name="searchUserName" autocomplete="off" class="layui-input">
                    </div>
                </div>
                <div class="layui-inline">
                    <label class="layui-form-label">手机号</label>
                    <div class="layui-input-inline">
                        <input type="text" name="searchPhoneNumber" autocomplete="off" class="layui-input">
                    </div>
                </div>
                <div class="layui-inline">
                    <button type="submit" class="layui-btn layui-btn-primary" lay-submit lay-filter="data-search-btn">
                        <i class="layui-icon"></i> 搜 索
                    </button>
                    <button class="layui-btn layui-btn-primary" lay-filter="search_reset"><i
                            class="layui-icon layui-icon-refresh"></i> 重置
                    </button>
                </div>
            </div>
        </form>
    </div>
</fieldset>

<!--=========================================================更新用户信息===============================================================-->
<form class="layui-form layui-form-pane" id="update_user_form" style="display:none;margin: 10px" lay-filter="update_user_form">
    <!--隐藏输入框，保存主键-->
    <input type="hidden" name="userId">
    <input type="hidden" name="loginName">
    <input type="hidden" name="password">
    <div class="layui-form-item">
        <label class="layui-form-label">真实姓名</label>
        <div class="layui-input-block">
            <input type="text" name="userName" lay-verify="required" lay-reqText="名字不能为空" placeholder="请输入真实姓名"
                   autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">邮箱</label>
        <div class="layui-input-block">
            <input type="text" name="email" lay-verify="email" placeholder="请输入电子邮箱" autocomplete="off"
                   class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">手机号</label>
        <div class="layui-input-inline">
            <input type="text" name="phonenumber" lay-verify="phone" placeholder="请输入手机号"
                   autocomplete="off"
                   class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">部门</label>
        <div class="layui-input-block deptId">
            <select name="deptId" lay-verify="required" lay-reqText="部门不能为空">
                <option th:each="dept:${deptList}" th:value="${dept.deptId}" th:text="${dept.deptName}"></option>
            </select>
        </div>
    </div>

    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">状态</label>
            <div class="layui-input-block">
                <input type="checkbox" name="status" lay-skin="switch" lay-text="正常|禁用" checked value="0">
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">性别</label>
            <div class="layui-input-block">
                <input type="radio" name="sex" value="0" title="男" checked="">
                <input type="radio" name="sex" value="1" title="女">
            </div>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">角色</label>
        <div class="layui-input-block">
            <input type="checkbox" class="role_check" th:each="role:${roleList}" th:name="${role.roleKey}"
                   th:value="${role.roleId}" th:title="${role.roleName}"/>
        </div>
        <input hidden="hidden" name="salt">
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">备注</label>
        <div class="layui-input-inline">
            <input type="text" name="remark" required lay-verify="required" placeholder="请输入备注信息" autocomplete="off"
                   class="layui-input">
        </div>
    </div>
    <div class="layui-form-item" align="center">
        <div class="layui-inline">
            <button class="layui-btn layui-btn-primary layui-btn-radius" lay-submit lay-filter="userUpdateBtn">
                <i class="layui-icon layui-icon-release"></i> 立即提交
            </button>
        </div>
        <div class="layui-inline">
            <button type="reset" class="layui-btn layui-btn-primary layui-btn-radius"><i class="layui-icon layui-icon-refresh"></i>重置
            </button>
        </div>
    </div>
</form>

<!--=========================================================重置密码==================================================================-->
<form class="layui-form"  id="reset_password_form" style="display: none;margin: 10px" lay-filter="reset_password_form">
    <!--隐藏输入框，保存主键-->
    <input type="hidden" name="userId">
    <div class="layui-form-item">
        <label class="layui-form-label">密码</label>
        <div class="layui-input-inline">
            <input type="password" name="password" required lay-verify="required" placeholder="请输入新密码" autocomplete="off"
                   class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-input-block">
            <button class="layui-btn layui-btn-primary layui-btn-radius" lay-submit lay-filter="formResetPassword-flter">
                <i class="layui-icon layui-icon-release"></i> 立即提交
            </button>
            <button type="reset" class="layui-btn layui-btn-primary layui-btn-radius"><i class="layui-icon layui-icon-refresh"></i>重置
            </button>
        </div>
    </div>
</form>

<!--=========================================================添加用户信息=============================================================-->
<form class="layui-form layui-form-pane" id="save_user_form" style="display:none;margin: 10px" lay-filter="save_user_form">

    <div class="layui-form-item">
        <label class="layui-form-label">登录名</label>
        <div class="layui-input-block">
            <input type="text" name="loginName" lay-verify="required" lay-reqText="账号不能为空" placeholder="请输入登录名称"
                   autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">密码</label>
        <div class="layui-input-block">
            <input type="password"  name="password" lay-verify="required" lay-reqText="密码不能为空" placeholder="请输入密码"
                   autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">真实姓名</label>
        <div class="layui-input-block">
            <input type="text" name="userName" lay-verify="required" lay-reqText="名字不能为空" placeholder="请输入真实姓名"
                   autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">邮箱</label>
        <div class="layui-input-block">
            <input type="text" name="email" lay-verify="email" placeholder="请输入电子邮箱" autocomplete="off"
                   class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">手机号</label>
        <div class="layui-input-inline">
            <input type="text" name="phonenumber" lay-verify="phone" placeholder="请输入手机号"
                   autocomplete="off"
                   class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">部门</label>
        <div class="layui-input-block deptId">
            <select name="deptId" lay-verify="required" lay-reqText="部门不能为空">
                <option th:each="dept:${deptList}" th:value="${dept.deptId}" th:text="${dept.deptName}"></option>
            </select>
        </div>
    </div>

    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">状态</label>
            <div class="layui-input-block">
                <input type="checkbox" name="status" lay-skin="switch" lay-text="正常|禁用" checked value="0">
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">性别</label>
            <div class="layui-input-block">
                <input type="radio" name="sex" value="0" title="男" checked="">
                <input type="radio" name="sex" value="1" title="女">
            </div>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">角色</label>
        <div class="layui-input-block">
            <input type="checkbox" th:each="role:${roleList}" name="role"
                   th:value="${role.roleId}" th:title="${role.roleName}"/>
        </div>
        <input hidden="hidden" name="salt">
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">备注</label>
        <div class="layui-input-inline">
            <input type="text" name="remark" required lay-verify="required" placeholder="请输入备注信息" autocomplete="off"
                   class="layui-input">
        </div>
    </div>
    <div class="layui-form-item" align="center">
        <div class="layui-inline">
            <button class="layui-btn layui-btn-primary layui-btn-radius" lay-submit lay-filter="userSaveBtn">
                <i class="layui-icon layui-icon-release"></i> 立即提交
            </button>
        </div>
        <div class="layui-inline">
            <button type="reset" class="layui-btn layui-btn-primary layui-btn-radius"><i class="layui-icon layui-icon-refresh"></i>重置
            </button>
        </div>
    </div>
</form>

<!--==========================================================表格模块==================================================================-->
<table class="layui-hide" id="demo" lay-filter="tbl"></table>

<!--==========================================================树型模块==================================================================-->
<div class="layui-form-item" id="choose_parent_dept" style="display: none">
    <label class="layui-form-label">所属部门</label>
    <div class="layui-input-inline">
        <div id="deptTreeChoose" class="demo-tree-more"></div>
    </div>
</div>
</body>
</html>
